<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="bolao" />
    <g:set var="entityName" value="${message(code: 'bet.label', default: 'Bet')}" />
    <g:set var="matchEntityName" value="${message(code: 'match.label', default: 'Match')}" />
    <title><g:message code="default.edit.label" args="[entityName]" /></title>
  </head>
  <body>
  <div class="body">
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${bet}">
      <div class="errors">
        <g:renderErrors bean="${bet}" as="list" />
      </div>
    </g:hasErrors>
    <g:form method="post" >
      <g:hiddenField name="id" value="${bet?.id}" />
      <g:hiddenField name="version" value="${bet?.version}" />
      <div class="dialog">
        <fieldset>
          <legend><g:message code="default.show.label" args="[matchEntityName]" /></legend>
          <table width="90%">
            <tbody>
              <tr>
                <td><g:message code="match.label"/>:</td>
                <td>${bet?.match?.team1?.name}&nbsp;x&nbsp;${bet?.match?.team2?.name}</td>
              </tr>
              <tr>
                <td><g:message code="match.venue.label"/>:</td>
                <td>${bet?.match?.venue}</td>
              </tr>
              <tr>
                <td><g:message code="match.matchDate.label"/>:</td>
                <td><g:formatDate date="${bet?.match?.matchDate}" formatName="date.format"/></td>
              </tr>
              <tr>
                <td><g:message code="match.matchTime.label"/>:</td>
                <td><g:formatDate date="${bet?.match?.matchDate}" formatName="time.format"/></td>
              </tr>
            </tbody>
          </table>
        </fieldset>
        <fieldset>
          <legend><g:message code="default.edit.label" args="[entityName]" /></legend>
          <table width="90%">
            <tbody>
              <tr style="text-align: center">
                <td class="${hasErrors(bean: bet, field: 'match', 'errors')}">
                  ${match?.team1?.name}
                </td>
                <td class="${hasErrors(bean: bet, field: 'score1', 'errors')}">
                  <g:textField size="2" maxsize="2" name="score1" value="${fieldValue(bean: bet, field: 'score1')}" />
                </td>
                <td>x</td>
                <td class="${hasErrors(bean: bet, field: 'score2', 'errors')}">
                  <g:textField  size="2" maxsize="2" name="score2" value="${fieldValue(bean: bet, field: 'score2')}" />
                </td>
                <td class="${hasErrors(bean: bet, field: 'match', 'errors')}">
                  ${match?.team2?.name}
                </td>
              </tr>
            </tbody>
          </table>
        </fieldset>
      </div>
      <div class="buttons">
        <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
        <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
      </div>
    </g:form>
  </div>
</body>
</html>
